import 'package:flutter/material.dart';
import '../bean/detail_result.dart';
import '../service/service_method.dart';

class DetailsInfoProvide with ChangeNotifier {
  GoodsDetailsListBean goodsInfo;
  bool isLeft = true;
  bool isRight = false;

  //从后台后续信息
  getGoodsInfo(String id) {
    var formData = {'goods_id': id};
    request('getGoodsDetailSingle', formData).then((val) {
      goodsInfo =
          DetailResult.fromJson(val).entity.goodsDetailResponse.goodsDetails[0];
      print('${goodsInfo.goodsName}');
      notifyListeners();
    });
  }

  //改变tabBar的状态
  changeLeftAndRight(String changeState) {
    if (changeState == 'left') {
      isLeft = true;
      isRight = false;
    } else {
      isLeft = false;
      isRight = true;
    }
    notifyListeners();
  }
}
